const {
    test_test3
} = require('./.logic');

const topo = test_test3.create({
    "name": "test3",
    configs:{
        a: {
            interceptor: function (args, info, root) {
                console.log('a interceptor')
                    // return true
            },
        },
        b: {
            validator: function (args) {
                // return new Error('ooooo failed')
            }
        },
        c:{
            validator: function (args) {
                // return false
            }
        }
    },
    "methods": {
        "a": function (arg, info, root) {},
        "b": function (arg, info, root) {},
        "e": function (arg, info, root) {},
        "d": function (arg, info, root) {},
        "f": function (arg, info, root) {},
        "h": function (arg, info, root) {},
        "c": function (arg, info, root) {
            return ['y']
        },
        "g": function (arg, info, root) {},
        "i": function (arg, info, root) {
            return ['y']
        }
    },
    "onBeforeEach": function (info, root) {},
    "onAfterEach": function (info, root) {},
    "onStartEach": function (info, root) {},
    "onEndEach": function (info, root) {
        console.log('onEndEach',info)
    }
});
topo.$console();
topo.$create({
    "name": "test3-1",
    debug:{
        code:'ws://localhost:9503/v1'
    },
}).$console('~');
// // topo.$start(参数)
["Start", "End", "a", "b", "e", "d", "f", "c", "g", "h", "i"].forEach(node=>{
    console.log(`#${node} 123`, Math.random())
});
// topo.$start(0)

["Start", "End", "a", "b", "e", "d", "f", "c", "g", "h", "i"].reverse().forEach(node=>{
    console.log(`~${node} 123`, Math.random())
});
module.exports = topo;